package net.dao.impl;

import java.util.List;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import net.dao.ToleranciaRubroDao;
import net.model.ToleranciaRubro;

@Repository(value ="toleranciaRubroDao")
public class ToleranciaRubroDaoImpl implements ToleranciaRubroDao {

	@Autowired SessionFactory sessionFactory;
	
	@Override
	public List<ToleranciaRubro> getAllToleranciaRubro() {
		return sessionFactory.getCurrentSession().createCriteria(ToleranciaRubro.class).list();
	}

	@Override
	public void saveToleranciaRubro(ToleranciaRubro toleranciaRubro) {
		sessionFactory.getCurrentSession().saveOrUpdate(toleranciaRubro);

	}

}
